package com.commander.gui.messages;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.MessageBox;

import com.commander.gui.CommanderGUIHandler;


/**
 * ErrorMessage.java
 * @author Kelly Grogan
 * 
 * This class displays a MessageBox showing a certain
 * error that occurred during runtime.
 */
public class ErrorMessage implements CommanderMessage {
	
	public ErrorMessage(String message){
		show(message);
	}

	@Override
	public void show(final String message) {
		MessageBox messageBox = new MessageBox(CommanderGUIHandler.getShell(), SWT.ERROR);
		messageBox.setText("Error!");
		messageBox.setMessage(message);
		messageBox.open();
	}
}